package cn.sciento.platform.app.assembler;

import cn.sciento.platform.api.dto.EventDTO;
import cn.sciento.platform.api.dto.EventRuleDTO;
import cn.sciento.platform.domain.entity.Event;
import cn.sciento.platform.domain.entity.EventRule;
import org.springframework.beans.BeanUtils;

/**
 * 事件DTO组装器
 *

 */
public class EventAssembler {

    private EventAssembler(){}

    public static EventDTO eventEntityToDto(Event event) {
        EventDTO dto = new EventDTO();
        BeanUtils.copyProperties(event, dto);
        return dto;
    }

    public static EventRuleDTO eventRuleEntityToDto(EventRule eventRule) {
        EventRuleDTO dto = new EventRuleDTO();
        BeanUtils.copyProperties(eventRule, dto);
        return dto;
    }

}
